package it.softphone.cmc.shared.entity;



public class ScriptletUtils {

	protected ScriptletUtils() {
	}

	public static ScriptletAsset initId( ScriptletAsset instance ) {
		
		instance.setId( AssetImpl.toKey(instance) );
		return instance;
	}
	
	public static ScriptletAsset initAsSample(ScriptletAsset instance ) {
		  
		  instance.setDescription("sample script");
		  instance.setContent( new StringBuilder()
						.append("/************************************************************************************").append('\n').append('\n')
						.append("* Entry point ").append('\n').append('\n')
						.append("* @param params Input parameters as javax.ws.rs.core.MultivaluedMap<String, String>").append('\n')
						.append("* @param hh Headers informations as javax.ws.rs.core.HttpHeaders").append('\n')
						.append("* @param ui Uri informations as javax.ws.rs.core.UriInfo").append('\n')
						.append("*************************************************************************************/").append('\n').append('\n')			
						.append("function main( params, hh, ui)").append('\n')	
						.append('{').append('\n').append('\n')
						.append('\t').append("return 'HELLO SABINA!';").append('\n').append('\n')
						.append('}').append('\n')
						.toString()
					);
		  instance.setType("");
		  return instance;
	  }
	
	

}
